FIELD OF THE INVENTION
The present invention relates to a cache mode selection method and system. More particularly, it concerns a cache mode selection method and system for dynamic selection of a cache mode.
A cached disk controller (DKC) has several cache modes, such as a basic mode, sequential access mode, and a cache load inhibit mode.
The basic mode loads into a cache mode all data of tracks including accessed dataset. If a subsequent access is made to the dataset on the same track, the dataset exists on the cache memory, or the access hits the dataset. Thus, the access should be made to the cache memory. The access is made at higher speed than to a disk storage. If access is made to another dataset which does not exist on the cache memory, the access misses the dataset. All the data of the tracks including the other dataset have to be loaded in the cache memory before the access should be made to the dataset. Response is increased as a hit ratio (the number of hits relative to the number of misses) is high. In general, the data on the cache memory is managed according to a least recently used (LRU) rule. The LRU rule is a rule defined to make the data referred to most recently remain in the cache memory. According to the LRU rule, the data can be retained a long time in cache memory if it is referred to frequently. The data which has not been referred to for a long time is put out of the cache memory when new data is loaded.
The sequential access mode loads all data of the tracks including accessed dataset data and of a few succeeding tracks. That is, the sequential access mode reads a plurality of tracks in advance. This mode has a higher hit ratio for a sequential access file. It is used to read the sequential access file. In general, the data in the cache memory is managed according to the LRU rule.
The cache load inhibit mode is the same as the basic mode except that it directly accesses the disk storage, but does not load data including the dataset of concern to the cache memory in the event of a cache-miss. This means that it does not put any data out of the cache memory.
In general, the cache modes explained above should be selected depending on an attribute of the dataset. As examples, for a random access dataset, the basic mode should be selected; for sequential access dataset, the sequential access mode should be selected.
On the other hand, a dynamic cache mode selection method was disclosed in an article entitled "Dynamic Cache Management: Can I/O Tuning Be Automated?" in the CMG '90 Proceedings, pp 932-938, by John G. Aschoff. This method monitors a total hit ratio of a cache memory and if the total hit ratio is lower than a predetermined lower total hit ratio limit, a cache mode is switched to a cache load inhibit mode. If the total hit ratio is too low, the response is made rather lower because of overhead of loading to the cache memory. This is avoided by switching the cache mode to the cache load inhibit mode
Of the conventional techniques described above, the selection method of the cache mode depending on the attribute of dataset cannot switch the cache mode dynamically. The method has the disadvantage that if the hit ratio is too low, the response is made rather lower because of overhead of loading to the cache memory.
As for the method that if the total hit ratio is lower than the predetermined lower total hit ratio limit, the cache mode is switched to the cache load inhibit mode, it monitors the total hit ratio only, ignoring the fact that the hit ratio differs with each dataset. Thus, the method has the disadvantage that even the dataset having a high hit ratio is put to the cache load inhibit mode, and the total performance is lowered unnecessarily.
On the other hand, as a use ratio of a data transmission path connected between the cache memory and the disk storage becomes high, the latency time is long. This lowers the I/O response.
If the use ratio of a data transmission path is too high, therefore, it is desirable that the cache mode should be set to the cache load inhibit mode after all.